﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WindowsFormsApplication1
{
    public partial class Form2 : Form
    {
        public Form2()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            Graphics g = this.CreateGraphics();
            Rectangle r = new Rectangle(50, 50, 200, 100);
            Pen p=new Pen (Color.Red ,3);
            Brush b = p.Brush;
            g.FillPie(p.Brush, r, 0, 60);
            g.FillPie(b, r, 60, 150);
            b = new SolidBrush(Color.Yellow);
            g.FillPie(b, r, 210, 150);
        }
        private void Fill(int[] percent, Color[] percolor)
        {
            Graphics g=this .CreateGraphics ();
            Rectangle r=new Rectangle(50,50,200,100);
            Brush b;
            int beginAngle=0;
            for (int i=0; i<percent .GetUpperBound (0);i++)
            {
                b=new SolidBrush (percolor [i]);
                g.FillPie(b,r,beginAngle , percent [i]);
                beginAngle +=percent [i];
                
            }
            
    }
    }
}
